package com.ruiboyun.liveapp.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by ${吴世芊} on 2017/4/20下午3:18.
 * Updated by  on
 * ArcheryPlus-Android
 * 本类功能:
 * 说明:
 */

public class FragmentAdapter extends FragmentPagerAdapter {
    List<Fragment> fragmentList;
private List<String> titles ;
    public FragmentAdapter(FragmentManager fm, List<Fragment> fragmentList, List<String> titles) {
        super(fm);
        this.fragmentList = fragmentList;
        this.titles=titles;
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getCount() {
        return fragmentList == null ? 0 : fragmentList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        /*if (position == 0) {


            return "对战直播";

        } else {
            return "个人直播";

        }*/
       return titles.get(position);
    }
}
